package com.mytaobao.repositories;

import com.mytaobao.pojo.Customer;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.repository.CrudRepository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface CustomerMethodNameRepository extends CrudRepository<Customer,Integer> {
    List<Customer> findByName(String name);

    Boolean existsByName(String name);

    @Transactional
    @Modifying
    Integer deleteByName(String name);

    List<Customer> findByNameLike(String name);
}
